{extend name="public/base" /}
{block name="title"}提现申请列表{/block}

{block name="content"}
<script language="javascript" type="text/javascript" src="<?php echo http_host(); ?>/js/My97DatePicker/WdatePicker.js"></script>
<h2 class="sub-header">提现申请列表 <small class="badge"><?php echo $list->total(); ?> 条</small></h2>

<form name="listarc" action="" method="get">
<div class="panel panel-default" style="margin:10px 0;">
<div class="bg-info" style="padding:10px;">
    <div class="form-inline" style="display:inline;float:left;">
        <div class="form-group">
            <label for="order_sn">起止时间:</label>
            <input id="start_date" name="start_date" autocomplete="off" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'})" size="10" type="text" class="form-control" placeholder="开始时间">
        </div>
        <div class="form-group">
            <label for="name">-</label>
            <input id="end_date" name="end_date" autocomplete="off" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'})" size="10" type="text" class="form-control" placeholder="结束时间">
        </div>
        <button type="submit" class="btn btn-success">查询</button>
		
		<div class="form-group" style="margin-left:100px;"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
		<button type="submit" class="btn btn-info" value="Submit">搜索一下</button>
    </div>
    <div style="clear:both;"></div>
</div>
</div>

<div class="panel panel-default">
<div class="table-responsive"><table class="table table-striped table-hover">
<thead><tr class="info">
<th>ID</th>
<th>用户名</th>
<th>提现金额</th>
<th>姓名</th>
<th>收款方式</th>
<th>收款账号</th>
<th>申请时间</th>
<th>状态</th>
<th>操作</th>
</tr></thead>
<tbody>
<?php if($list){foreach($list as $row){ ?><tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['user']['user_name']; ?><?php if($row['user']['mobile']){echo '<br>TEL:'.$row['user']['mobile'];} ?></td>
<td><font color="red"><?php echo $row['money']; ?></font></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['method']; ?></td>
<td>账号：<?php echo $row['account']; if($row['bank_name']){echo '<br>银行名称：'.$row['bank_name'];}if($row['bank_place']){echo '<br>开户行：'.$row['bank_place'];} ?></td>
<td><?php echo date('Y-m-d H:i:s',$row['add_time']); ?></td>
<td><?php echo $row['status_text']; ?></td>
<td><?php if($row['status']==0){ ?><a href="javascript:change_status(<?php echo $row['id']; ?>,'1');">成功</a>&nbsp;<a href="javascript:change_status(<?php echo $row['id']; ?>,'0');">拒绝</a><?php } ?></td>
</tr><?php }} ?>
</tbody></table></div><!-- 表格结束 --></form><!-- 表单结束 -->

<div class="backpages">{$page}</div>

<script type="text/javascript" src="/js/layer/layer.js"></script>
<script>
function change_status(id,type)
{
    //询问框
    layer.confirm('您确定要执行此操作吗？', {
        btn: ['确定','取消'] //按钮
    }, function(){
        var url = window.location.href;
        $.post('<?php echo url('user_withdraw/change_status'); ?>',{id:id,type:type},function(res){
            //提示层
            layer.msg(res.msg,{
                time: 2000, //2s后自动关闭
            });
			
			if(res.code==0)
            {
                setTimeout(function(){ location.href = url; }, 1000);
            }
            else
            {
                
            }
            
        });
    }, function(){
        
    });
}
</script>
{/block}